<?php 
// 引入全局函数库
include './functions.php';
//读数据库文件
$oldData = file_get_contents('./Db/msg.txt');
//把json数据库数组
$oldData = json_decode($oldData,true);
//引首页模板
//
$count = count($oldData);

$num = 4;

$total =ceil($count/$num);

$p = isset($_GET['p']) ? $_GET['p'] : 1;

krsort($oldData);

$oldData = array_slice($oldData,($p-1)*$num,$num,true);

// var_dump($oldData);

// var_dump($count,$num,$total,$p);

include './Tpl/index.html';
 ?>